<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width">
    <meta name="keywords" content="网站关键词">
    <meta name="description" content="网站描述">
    <title>修改地址</title>
    <link rel="stylesheet" href="/index/css/style.css">
    <link rel="stylesheet" href="/index/css/responsive.css" />
    <script src="/public/jquery-1.12.3.min.js"></script>
    <script type="text/javascript" src="/index/js/jquery.slide.js"></script>
    <script type="text/javascript" src="/index/js/addons.js" ></script>
    <script type="text/javascript" src="/index/js/user.js" ></script>
    <!--[if lt IE 9]>
    <script src="/index/js/html5.index/js"></script>
    <![endif]-->
</head>
<body style="background: #f8f8f8;">
<!--conter -->
<div class="contert-box wrapper clearfix"style="margin-left: 0px;">
    <div class="right-box fr" style="height: auto;float: left">
        <h6></h6>
        <div class="data">
            <form>
                <ul>
                    <li class="clearfix">
                        <h5 class="fl">地区选择：</h5>
                        <div class="fl select">
                            <select name="shen" id="shen">
                                <option value="{$shengInfo.id}">{$shengInfo.name}</option>
                                {volist name='shengList' id='info'}
                                <option value="{$info.id}">{$info.name}</option>
                                {/volist}
                            </select>
                            <select name="shi" id="shi">
                                <option value="{$shiInfo.id}">{$shiInfo.name}</option>
                            </select>
                            <select name="xian" id="xian">
                                <option value="{$xianInfo.id}">{$xianInfo.name}</option>
                            </select>
                        </div>
                    </li>
                    <li class="clearfix">
                        <h5 class="fl">详细地址：</h5>
                        <div class="inps fl">
                            <textarea type="text" id="address">{$addressInfo.address}</textarea>
                        </div>
                    </li>
                    <li class="clearfix">
                        <h5 class="fl">收货人姓名：</h5>
                        <div class="inps fl">
                            <input type="text" id="name" value="{$addressInfo.nick_name}" />
                        </div>
                    </li>
                    <li class="clearfix">
                        <h5 class="fl">手机号码：</h5>
                        <div class="inps fl">
                            <input type="text" id="tel" value="{$addressInfo.tel}"/>
                        </div>
                    </li>
                </ul>
            </form>
            <div class="checkbox clearfix">
                <label><input type="checkbox" {notempty name="addressInfo.default"}checked="checked" value="1"{/notempty}{empty name="addressInfo.default"} value="0"{/empty} id="check_address"/><span>设置为默认收货地址</span></label>
                <div class="fl"><button onclick="edit_submit({$addressInfo.address_id})">提交</button></div>
            </div>
        </div>
    </div>
</div>
<!--conter end-->
{include file="public/comscript" /}
</body>
</html>
<script>
    $("#shen").change(function(){
        var url = "addressList";
        var opt=$("#shen").val();
        address_post_sub(url,{id:opt},$('#shi'));
        $("#address").val($('#shen').find("option:selected").text());
    });
    $("#shi").change(function(){
        var url = "addressList";
        var opt=$("#shi").val();
        address_post_sub(url,{id:opt},$('#xian'));
        $("#address").val($('#shen').find("option:selected").text()+$('#shi').find("option:selected").text());
    });
    $("#xian").change(function(){
        $("#address").val($('#shen').find("option:selected").text()+$('#shi').find("option:selected").text()+$('#xian').find("option:selected").text());
    });
    $("#check_address").change(function() {
        if($("#check_address").val()=='0'){
            $("#check_address").val(1);
        }else {
            $("#check_address").val(0);
        }
    });
</script>